Skip to content

redo destroy pg#435

Open
JacksonYao287 wants to merge 1 commit into
eBay:stable/v4.xfrom
JacksonYao287:fix-issues-of-destroy-pg
Open

redo destroy pg#435
JacksonYao287 wants to merge 1 commit into
eBay:stable/v4.xfrom
JacksonYao287:fix-issues-of-destroy-pg

Conversation

@JacksonYao287

Copy link
Copy Markdown
Collaborator

No description provided.

@codecov-commenter

codecov-commenter commented Jun 16, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 54.54545% with 10 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (stable/v4.x@e1c23e1). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/lib/homestore_backend/hs_pg_manager.cpp 58.33% 5 Missing ⚠️
...ib/homestore_backend/replication_state_machine.cpp 55.55% 4 Missing ⚠️
src/lib/homestore_backend/gc_manager.cpp 0.00% 0 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@              Coverage Diff               @@
##             stable/v4.x     #435   +/-   ##
==============================================
  Coverage               ?   53.29%           
==============================================
  Files                  ?       36           
  Lines                  ?     5404           
  Branches               ?      677           
==============================================
  Hits                   ?     2880           
  Misses                 ?     2226           
  Partials               ?      298           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JacksonYao287 JacksonYao287 force-pushed the fix-issues-of-destroy-pg branch from 0b5e4a4 to c686ce2 Compare June 16, 2026 11:59
Comment thread src/lib/homestore_backend/hs_pg_manager.cpp Outdated
Comment thread src/lib/homestore_backend/replication_state_machine.cpp
@@ -499,7 +503,7 @@ void ReplicationStateMachine::write_snapshot_obj(std::shared_ptr< homestore::sna
if (home_object_->pg_exists(pg_data->pg_id())) {
LOGI("pg already exists, clean pg resources before snapshot, pg={} {}", pg_data->pg_id(), log_suffix);
// Need to pause state machine before destroying the PG, if fail, let raft retry.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments out of date, as well as we dont have a branch that returns false as of now.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let`s remove this out-of-date comments after addressing other comments for this PR

Comment thread src/lib/homestore_backend/hs_pg_manager.cpp Outdated
Comment thread src/lib/homestore_backend/replication_state_machine.cpp
@JacksonYao287 JacksonYao287 force-pushed the fix-issues-of-destroy-pg branch from c686ce2 to 41de75e Compare June 18, 2026 07:11
Comment on lines +1064 to +1066
// error. but actually, this is not a problem. since before we starting pg_destroy in baseline resync,
// m_rd_sb->last_snapshot_lsn will be persisted upto the snapshot.get_last_log_idx(). then all the log less than
// or equal to m_rd_sb->last_snapshot_lsn will not be replayed or committed after recovery. so, the concern is

@JacksonYao287 JacksonYao287 Jun 18, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiaoxichen in baseline resync case , before we start destroying pg, we will m_rd_sb->last_snapshot_lsn upto snapshot.get_last_log_idx(). then raft_repl_dev#need_skip_processing will help us skipping replaying all the logs in recovery path(so that we will not hit those destroyed resources , like pg_index_table, etc.). so we don`t need wait for all the appended log to be committed in pg_destroy for BR case

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so basically you reverted your changes

@xiaoxichen xiaoxichen Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont get the point of this comments, you said for br no need to redo destroy PG but we do it anyway.

The concern of log replay vs destroy is not valid here ... if we reach here the log replay had been done...If we want to record the thinking why waiting for log commit is not needed, better rephrase this paragraph and move it to destroy_pg

Similar for L1043-1052, those lines explains the situations that a PG can be destroy, better to move to destroy_pg rather than here, especially we use same action in recovery path , for all source

@JacksonYao287 JacksonYao287 requested a review from xiaoxichen June 18, 2026 07:16

@xiaoxichen xiaoxichen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM aside from inline comments cleanup.

Try to use LLM to polish the language a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants